#把字符串'123.456'转换成浮点数123.456:
from functools import reduce
def str2float(s):
	d = {'1':1,'2':2,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9,'0':0}
	S = s.split('.')
	def char2num(s):
		return d[s]
	a = reduce(lambda x, y: x * 10 + y, map(char2num, S[0]))
	b = reduce(lambda x, y: x * 10 + y, map(char2num, S[1]))

	return a + b*0.1**len(S[1])

l1 = '123.456'
l2 = str2float(l1)
print(l2)


